/*
 * Copyright (c) 2025-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef EFFICIENCY_MANAGER_SUSPEND_MANAGER_LOG_H
#define EFFICIENCY_MANAGER_SUSPEND_MANAGER_LOG_H

#include "hilog/log.h"

#ifndef FORMAT_LOG
#define FORMAT_LOG(fmt, ...) "[(%{public}s):%{public}d] " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__
#endif

#define SUSPEND_LOGD(_domain, _tag, fmt, ...) HILOG_IMPL(LOG_CORE, LOG_DEBUG, _domain, _tag, fmt, ##__VA_ARGS__)
#define SUSPEND_LOGI(_domain, _tag, fmt, ...) HILOG_IMPL(LOG_CORE, LOG_INFO, _domain, _tag, fmt, ##__VA_ARGS__)
#define SUSPEND_LOGW(_domain, _tag, fmt, ...) HILOG_IMPL(LOG_CORE, LOG_WARN, _domain, _tag, fmt, ##__VA_ARGS__)
#define SUSPEND_LOGE(_domain, _tag, fmt, ...) HILOG_IMPL(LOG_CORE, LOG_ERROR, _domain, _tag, fmt, ##__VA_ARGS__)
#define SUSPEND_LOGF(_domain, _tag, fmt, ...) HILOG_IMPL(LOG_CORE, LOG_FATAL, _domain, _tag, fmt, ##__VA_ARGS__)

// log API for common scenarios
#define SUSPEND_MANAGER_DOMAIN 0xD001713
#define SUSPEND_MANAGER_TAG "SUSPEND_MANAGER"
#define SUSPEND_MANAGER_LOGD(...) SUSPEND_LOGD(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MANAGER_LOGI(...) SUSPEND_LOGI(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MANAGER_LOGW(...) SUSPEND_LOGW(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MANAGER_LOGE(...) SUSPEND_LOGE(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MANAGER_LOGF(...) SUSPEND_LOGF(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, FORMAT_LOG(__VA_ARGS__))

#define SUSPEND_MANAGER_PRIVACY_LOGD(...) SUSPEND_LOGD(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, ##__VA_ARGS__)
#define SUSPEND_MANAGER_PRIVACY_LOGI(...) SUSPEND_LOGI(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, ##__VA_ARGS__)
#define SUSPEND_MANAGER_PRIVACY_LOGW(...) SUSPEND_LOGW(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, ##__VA_ARGS__)
#define SUSPEND_MANAGER_PRIVACY_LOGE(...) SUSPEND_LOGE(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, ##__VA_ARGS__)
#define SUSPEND_MANAGER_PRIVACY_LOGF(...) SUSPEND_LOGF(SUSPEND_MANAGER_DOMAIN, SUSPEND_MANAGER_TAG, ##__VA_ARGS__)

// log API for plugin and event msg
#define SUSPEND_MSG_DOMAIN 0xD001731
#define SUSPEND_MSG_TAG "SUSPEND_MSG"
#define SUSPEND_MSG_LOGD(...) SUSPEND_LOGD(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MSG_LOGI(...) SUSPEND_LOGI(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MSG_LOGW(...) SUSPEND_LOGW(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MSG_LOGE(...) SUSPEND_LOGE(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_MSG_LOGF(...) SUSPEND_LOGF(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, FORMAT_LOG(__VA_ARGS__))

#define SUSPEND_MSG_PRIVACY_LOGD(...) SUSPEND_LOGD(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, ##__VA_ARGS__)
#define SUSPEND_MSG_PRIVACY_LOGI(...) SUSPEND_LOGI(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, ##__VA_ARGS__)
#define SUSPEND_MSG_PRIVACY_LOGW(...) SUSPEND_LOGW(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, ##__VA_ARGS__)
#define SUSPEND_MSG_PRIVACY_LOGE(...) SUSPEND_LOGE(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, ##__VA_ARGS__)
#define SUSPEND_MSG_PRIVACY_LOGF(...) SUSPEND_LOGF(SUSPEND_MSG_DOMAIN, SUSPEND_MSG_TAG, ##__VA_ARGS__)

// log API for resource proxy
#define SUSPEND_PROXY_DOMAIN 0xD001732
#define SUSPEND_PROXY_TAG "SUSPEND_PROXY"
#define SUSPEND_PROXY_LOGD(...) SUSPEND_LOGD(SUSPEND_PROXY_DOMAIN, SUSPEND_PROXY_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_PROXY_LOGI(...) SUSPEND_LOGI(SUSPEND_PROXY_DOMAIN, SUSPEND_PROXY_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_PROXY_LOGW(...) SUSPEND_LOGW(SUSPEND_PROXY_DOMAIN, SUSPEND_PROXY_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_PROXY_LOGE(...) SUSPEND_LOGE(SUSPEND_PROXY_DOMAIN, SUSPEND_PROXY_TAG, FORMAT_LOG(__VA_ARGS__))
#define SUSPEND_PROXY_LOGF(...) SUSPEND_LOGF(SUSPEND_PROXY_DOMAIN, SUSPEND_PROXY_TAG, FORMAT_LOG(__VA_ARGS__))

// simplified Log
#define SUSPEND_MANAGER_SIMPLE_LOGD(...) HILOG_DEBUG(LOG_CORE, ##__VA_ARGS__)
#define SUSPEND_MANAGER_SIMPLE_LOGI(...) HILOG_INFO(LOG_CORE, ##__VA_ARGS__)
#define SUSPEND_MANAGER_SIMPLE_LOGW(...) HILOG_WARN(LOG_CORE, ##__VA_ARGS__)
#define SUSPEND_MANAGER_SIMPLE_LOGE(...) HILOG_ERROR(LOG_CORE, ##__VA_ARGS__)
#define SUSPEND_MANAGER_SIMPLE_LOGF(...) HILOG_FATAL(LOG_CORE, ##__VA_ARGS__)
#endif // EFFICIENCY_MANAGER_SUSPEND_MANAGER_LOG_H